#pragma once

#include "Point3D.h"

#include "HSModelAPI.h"
#include "GeometryUtils.h"

#include <list>

class Triangle3D
  {
  public:
   // HSMODEL_API const Point3D& GetPoint(unsigned int i_number) const; // i_number from 0 to 2
    // wildmagic point
    HSMODEL_API const TVector3& GetPoint(unsigned int i_number) const;
    HSMODEL_API const TVector2& GetPointUV(unsigned int i_number) const;
		HSMODEL_API const TVector3& GetPointNormal(unsigned int i_number) const;

    HSMODEL_API Point3DID GetPointId(unsigned int i_number) const;

    HSMODEL_API void SetPointsUV(const TVector2 &i_firstUV, const TVector2 &i_secondUV, const TVector2 &i_thirdUV);
		HSMODEL_API void SetPointNormals(const TVector3& i_first_normal, const TVector3& i_second_normal, const TVector3& i_third_normal);

  private:
    Triangle3D() {}; // forbidden
    Triangle3D(const Point3DID &i_first, const Point3DID &i_second, const Point3DID &i_third);
    Triangle3D(const Triangle3D &i_other);
    
    friend class Model3D;

  private:
    Point3DID m_points[3];
    TVector2 m_uv_coords[3];
		TVector3 m_point_normals[3];
  };

class Triangle3DID
  {
  private:
    Triangle3DID() {}; // forbidden!
    Triangle3DID(Triangle3D* i_object);

    friend class Model3D;
  public:
    HSMODEL_API Triangle3D& GetTriangle();
  private:
    Triangle3D* m_object;
  };